function Pet(name) {
    this.name = name
    this.getName = function () { return this.name }
}

// const cat = new Pet("bigyoung")
console.log(Pet.getName());
// const { getName } = cat;
// console.log(getName());

var length = 4
function callback() {
    console.log(this.length);
}
const obj = {
    length: 5,
    method() {
        console.log(arguments);
        arguments[0]()
        console.log(arguments.length);
    }
}
obj.method(callback, 1, 2);

const user = {
    name: 'a',
    updateName: name => {
        this.name = name
    }
}
user.updateName('bbbb')
console.log(user.name);
console.log(this.name);